<%@ page import="com.jkt.rms.commons.includes.*"%>
<%@ page import="java.util.*"%>
<%@ page import="com.jkt.rms.business.*"%>

<%@ include file="/WEB-INF/jsp/include.jsp"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="spring" uri="/spring"%>
<html>
<head>
<script language="javascript"
	src="<%=PathDefinations.jsPath%>calendar.js"></script>
<script language="javascript">

<%Calendar calendar = Calendar.getInstance();

			String month = String.valueOf((calendar.get(Calendar.MONTH)) + 1);
			String date = String.valueOf(calendar.get(Calendar.DATE));
			String serverdate;
			int year = calendar.get(calendar.YEAR);
			if (month.length() < 2) {
				month = "0" + month;
			}
			if (date.length() < 2) {
				date = "0" + date;
			}%>

	var serverdate = '<%=date + "/" + month + "/" + year%>';
</script>


<title><fmt:message key="lbl.title.updateProjectTitle" /></title>
</head>
<body>
<center><br>
<div id="headerbar"><fmt:message
	key="lbl.title.updateProjectTitle" /></div>
<c:if test="${ not empty errors.allErrors}">
	<div id="errorFieldSet">
	<fieldset><legend>Errors</legend> <c:forEach var="err"
		items="${errors.allErrors}">
		<spring:message code="${err.code}" arguments="${err.arguments}" />
		<br />
	</c:forEach></fieldset>
	</div>
</c:if> <c:if test="${not empty infoMsg}">
	<div id="infoFieldSet">
	<fieldset><legend>Information</legend> <c:out
		value="${infoMsg}" /></fieldset>
	</div>
</c:if> <spring:hasBindErrors name="errors"></spring:hasBindErrors>

<div id="content">
<div><br>
<form:form method="POST" action="project.htm?method=saveUpdatedProject"
	commandName="projectVO">
	<table width="100%">
		<tr>
			<td><label>Project No*:</label></td>
			<td><form:input path="projectNumber" maxlength="10" /> <input
				type="hidden" name="id" value="${projectVO.id}" /></td>
			<td><label>Project Type*:</label></td>
			<td><form:input path="projectType" maxlength="100" /></td>
		</tr>
		<tr>
			<td><label>Project Name*:</label></td>
			<td><form:input path="projectName" maxlength="50" /></td>
			<td><label>Purchase Order No*:</label></td>
			<td><form:input path="purchaseOrderNo" maxlength="10" /></td>
		</tr>
		<tr>
			<td><label>Project Manager*:</label></td>
			<td><form:input path="projectManager" maxlength="100" /></td>
			<td><label>Delivery Manager*:</label></td>
			<td><form:input path="deliveryManager" maxlength="100" /></td>
		</tr>
		<tr>
			<td><label>Cost Centre*:</label></td>
			<td><form:input path="costCentre" maxlength="10" /></td>
			<td><label>Line Of Business*:</label></td>
			<td><form:input path="lineOfBusiness" maxlength="100" /></td>
		</tr>
		<tr>
			<td><label>Planned Start Date*:</label></td>
			<td><input type='text' name='projectExpectedStartDate'
				id='projectExpectedStartDate' readonly maxlength="10"
				value="<fmt:formatDate value="${projectVO.projectExpectedStartDate}" pattern="${initParam.dateformat}" type="date" />" />
			<a
				href="javascript:setdate('',document.getElementById('projectExpectedStartDate'))"
				class="calender"><img
				src="<%=PathDefinations.imagePath%>cal.gif" width="16" height="16"
				border="0" /></a></td>
			<td><label>Planned End Date*:</label></td>
			<td><input type='text' name='projectExpectedEndDate'
				id='projectExpectedEndDate' readonly maxlength="10"
				value="<fmt:formatDate value="${projectVO.projectExpectedEndDate}" pattern="${initParam.dateformat}" type="date" />" />
			<a
				href="javascript:setdate('',document.getElementById('projectExpectedEndDate'))"
				class="calender"><img
				src="<%=PathDefinations.imagePath%>cal.gif" width="16" height="16"
				border="0" /></a></td>
		</tr>
		<tr>
			<td><label>Actual Start Date:</label></td>
			<td><input type='text' name='projectActualStartDate'
				id='projectActualStartDate' readonly maxlength="10"
				value="<fmt:formatDate value="${projectVO.projectActualStartDate}" pattern="${initParam.dateformat}" type="date" />" />
			<a
				href="javascript:setdate('',document.getElementById('projectActualStartDate'))"
				class="calender"><img
				src="<%=PathDefinations.imagePath%>cal.gif" width="16" height="16"
				border="0" /></a></td>

			<td><label>Actual End Date:</label></td>
			<td><input type='text' name='projectActualEndDate'
				id='projectActualEndDate' readonly maxlength="10"
				value="<fmt:formatDate value="${projectVO.projectActualEndDate}" pattern="${initParam.dateformat}" type="date" />" />
			<a
				href="javascript:setdate('',document.getElementById('projectActualEndDate'))"
				class="calender"><img
				src="<%=PathDefinations.imagePath%>cal.gif" width="16" height="16"
				border="0" /></a></td>
		</tr>

		<tr>
			<td><label>Status :</label></td>
			<td><form:select path="status">
				<form:option value="Y">Active</form:option>
				<form:option value="N">Inactive</form:option>
			</form:select></td>
			<td><label>Line of business:</label></td>
			<td><form:textarea cols="30" rows="5" path="projectDescription" onkeyup="textCounter(this,400)" /></td>
		</tr>

		<tr>
			<td align="right" valign="bottom" colspan="4">
			<input type="submit" name='Update' value="Update" /> 
			<input type="button" name='Cancel' value="Back to Search Result" onclick="dosubmit('projectVO','project.htm?method=cancelUpdateProject')" /></td>
		</tr>
	</table>
</form:form></div>
<p></p>
<br>
</div>

<%@ include file="footer.jsp"%></center>
</body>
</html>
